<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>数组长度</title>
    <script>
        //承接上街课的题
        //课堂案例:
        //请将['关羽','张飞','马超','赵云','黄忠','刘备','姜维'];数组里的袁术依次打印到控制台
        var arr = ['关羽', '张飞', '马超', '赵云', '黄忠', '刘备', '姜维'];
        for (var j = 0; j < 7; j++) {
            console.log(arr[j]);
        }
        console.log(arr.length);
        for (var j = 0; j < arr.length; j++) {
            console.log(arr[j]);
        }
        //1.数组的长度是元素的个数  不用跟索引号混淆
        //2.arr.length 动态检测数组的个数
    </script>
</head>

<body>

</body>

</html>